#!/bin/sh

uci -q batch <<-EOF >/dev/null
	delete firewall.v2ray_server
	set firewall.v2ray_server=include
	set firewall.v2ray_server.type=script
	set firewall.v2ray_server.path=/usr/share/v2ray_server/firewall.include
	set firewall.v2ray_server.reload=1
EOF

uci -q batch <<-EOF >/dev/null
	delete ucitrack.@v2ray_server[-1]
	add ucitrack v2ray_server
	set ucitrack.@v2ray_server[-1].init=v2ray_server
	commit ucitrack
EOF

chmod a+x /usr/share/v2ray_server/* >/dev/null 2>&1

rm -f /tmp/luci-indexcache
exit 0
